if exists (select 1
   from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
   where r.fkeyid = object_id('Customer') and o.name = 'FK_Employee_Customer')
alter table Customer
   drop constraint FK_Employee_Customer
GO

ALTER TABLE Customer DROP COLUMN SalesEmployeeCode

ALTER TABLE Customer ADD EmployeeRoleID INT
alter table Customer
   add constraint FK_EmployeeRole_Customer foreign key (EmployeeRoleID)
      references dbo.Role (ID)
go

ALTER TABLE Customer DROP COLUMN [Type]
ALTER TABLE Customer DROP COLUMN IsAlsoSupplier
ALTER TABLE Customer DROP COLUMN CheckType

ALTER TABLE Customer ADD [Type] INT
ALTER TABLE Customer ADD AgentType INT
ALTER TABLE Customer ADD InvoiceType INT

